package org.codeart.pattern.memento.draft;

/**
 * 发起人角色编辑器类
 */
public class Editor {

    private String title;

    private String content;

    private String images;

    public Editor(String title, String content, String images) {
        this.title = title;
        this.content = content;
        this.images = images;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images;
    }

    public ArticleMemento saveToMemento() {
        return new ArticleMemento(title, content, images);
    }

    public void undoFromMemento(ArticleMemento articleMemento) {
        this.title = articleMemento.getTitle();
        this.content = articleMemento.getContent();
        this.images = articleMemento.getImages();
    }

    @Override
    public String toString() {
        return "Editor{" + "title='" + title + '\'' + ", content='" + content + '\'' + ", images='" + images + '\'' + '}';
    }
}
